精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
You can use clipping regions to restrict your output to a specified subregion of the client area. To use a clipping region, you must select it into the device context associated with the display device.
你能使用剪切区域来限制你的输出到一个具体的客户区的子区域。为了使用剪切区域,你必须选择把它选入到和显示设置相关联的设备描述表中。
Clipping is used in Windows CE in a variety of ways. Word processing and spreadsheet applications clip keyboard input to keep it from appearing in the margins of a page or spreadsheet. Computer-aided design (CAD) and drawing applications clip graphics output to keep it from overwriting the edges of a drawing or picture.
在Windows CE中可以以很多方式使用剪切区域。字处理和电子制表应用程序修正键盘输入用来防止它显示在页面或电子表的边区上。计算机辅助设计(CAD)和绘图程序修正图形输出用来防止它越出图形或图片的边界外部。
Some device contexts provide a predefined or default clipping region. For example, the device context created by the BeginPaint contains a predefined rectangular clipping region that corresponds to the invalid rectangle that needs to be repainted. However, the device contexts created by the CreateDC and GetDC functions contain empty clipping regions; clipping is only done to keep graphics output in the window's client area.
一些设备描述表提供一个预先定义或者默认的剪切区域。举个例子,由BeginPaint创建的设备描述表包含一个预先定义的矩形剪切区域,它用于通知需要重新刷新的无效矩形区域。然而,由CreateDC和GetDC创建的设备描述表包含空的剪切区域;剪切只是为了保持输出到客户区而完成。
You can perform a variety of operations on clipping regions. Some of these operations require a handle identifying the region and some do not. For example, you can perform the following operations directly on a device context's clipping region. 对剪切区域可进行一系列操作。操作需要句柄,句柄能标识区域,有些操作不需要。比如,下面的操作可以直接处理设备上下文的剪切区域。
After obtaining a handle identifying the clipping region, you can perform any operation that is common with regions, such as: 获取句柄后,操作多了: